
// <copyright file="CounterValueInfo.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   The counter value info.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Diagnostics.Performance.Dtos
{
    using System;

    using SubhadraSolutions.Sharp.Utils.Reflection;

    /// <summary>
    /// The counter value info.
    /// </summary>
    [Serializable]
    public class CounterValueInfo
    {
        #region Constructors and Finalizers

        /// <summary>
        /// Initializes a new instance of the <see cref="CounterValueInfo"/> class.
        /// </summary>
        public CounterValueInfo()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CounterValueInfo"/> class.
        /// </summary>
        /// <param name="counterName">
        /// The counter name.
        /// </param>
        /// <param name="rawValue">
        /// The raw value.
        /// </param>
        public CounterValueInfo(string counterName, double rawValue)
        {
            this.CounterName = counterName;
            this.RawValue = rawValue;
        }

        #endregion Constructors and Finalizers

        #region Public Properties

        /// <summary>
        /// Gets or sets the counter name.
        /// </summary>
        public string CounterName { get; set; }

        /// <summary>
        /// Gets or sets the raw value.
        /// </summary>
        public double RawValue { get; set; }

        #endregion Public Properties

        #region Public Methods and Operators

        /// <summary>
        /// The create new.
        /// </summary>
        /// <param name="counterName">
        /// The counter name.
        /// </param>
        /// <param name="rawValue">
        /// The raw value.
        /// </param>
        /// <returns>
        /// The <see cref="CounterValueInfo"/>.
        /// </returns>
        public static CounterValueInfo CreateNew(string counterName, double rawValue)
        {
            return new CounterValueInfo(counterName, rawValue);
        }

        /// <summary>
        /// The to string.
        /// </summary>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        public override string ToString()
        {
            return DynamicToStringHelper<CounterValueInfo>.ExportAsString(this);
        }

        #endregion Public Methods and Operators
    }
}